﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using web.data.entities;
using web.bussines;
using Webdiyer.WebControls.Mvc;
using System.Web.UI;

namespace web.core.Models
{
    public class profileModels
    {
        public static PagedList<employee> getPageListEmployee(int pageindex, int pagesite, string text_search, string option_search, int? department_id, byte? employee_status, DateTime? birth_day, int? b_day, int? b_month, int? b_year, bool? join_dang, string study_level, string blood_group, string current_address, int? start_date_insurance, string positions, string foreign_language, string house_land_status, int? date_join, string type_list_employee, ref int total_record, bool? gender, int? army_join, string ranks, int? school_id, string marital_status)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getPageListEmployee(pageindex, pagesite, text_search, option_search, department_id, employee_status, birth_day, b_day, b_month, b_year, join_dang, study_level, blood_group, current_address, start_date_insurance, positions, foreign_language, house_land_status, date_join, type_list_employee, ref total_record, gender, army_join, ranks, school_id, marital_status);
        }

        public static List<employee> GetListEmployeeAutoCompleted(string text)
        {
            profile_service proSvc = new profile_service();
            return proSvc.GetListEmployeeAutoCompleted(text, 1, 20);
        }

        public static employee getEmployeeByID(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getEmployeeByID(id);
        }

        public static List<employee_family> getListEmployeeFamilyByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeFamilyByEmployee(id);
        }

        //public static List<employee_house_land> getListEmployeeHouseLandByEmployee(int id)
        //{
        //    profile_service proSvc = new profile_service();
        //    return proSvc.getListEmployeeHouseLandByEmployee(id);
        //}

        public static List<employee_insurance> getListEmployeeInsuranceByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeInsuranceByEmployee(id);
        }

        public static List<employee_job_severance> getListEmployeeJobSeveranceByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeJobSeveranceByEmployee(id);
        }

        public static List<employee_medical_records> getListEmployeeMedicalRecodByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeMedicalRecodByEmployee(id);
        }

        public static List<employee_rotation> getListEmployeeRotationByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeRotationByEmployee(id);
        }

        public static List<employee_school> getListEmployeeSchoolByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeSchoolByEmployee(id);
        }

        public static List<employee_visa_passport> getListEmployeeVisaPassportByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeVisaPassportByEmployee(id);
        }

        public static school getSchoolByID(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getSchoolByID(id);
        }

        public static List<contract> getListContractByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListContractByEmployee(id);
        }

        public static type_contract getTypeContractByID(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getTypeContractByID(id);
        }

        public static departments getDepartmentByID(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getDepartmentByID(id);
        }

        public static List<departments> getListDepartment()
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListDepartment();
        }

        public static contract getLastContractByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getLastContractByEmployee(id);
        }

        public static List<employee_family> getListEmployeeFamily(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeFamily(id);
        }

        public static List<employee_foreign_countries> getListEmployeeForeignCountryByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployeeForeignCountryByEmployee(id);
        }

        public static PagedList<employee_reward> getListEmployee_QNCN_CNVQP(int pageindex, int pagesize, string option_search, int? department_id, byte? employee_status, DateTime? from_date, DateTime? to_date, int? type_report)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_QNCN_CNVQP(pageindex, pagesize, option_search, department_id, employee_status, from_date, to_date, type_report);
        }

        public static List<employee_reward> getListEmployee_QNCN_CNVQP_export(string option_search, int? department_id, byte? employee_status, DateTime? from_date, DateTime? to_date, int? type_report)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_QNCN_CNVQP_export(option_search, department_id, employee_status, from_date, to_date, type_report);
        }

        public static List<departments> getListDepartmentsByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListDepartmentsByEmployee(id);
        }

        public static PagedList<departments> getListEmployee_DG_CB_QH(int pageindex, int pagesize, string text_search, DateTime? from_date, DateTime? to_date)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_DG_CB_QH(pageindex, pagesize, text_search, from_date, to_date);
        }

        public static List<departments> getListEmployee_DG_CB_QH_export(string text_search, DateTime? from_date, DateTime? to_date)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_DG_CB_QH_export(text_search, from_date, to_date);
        }

        public static employee_ranks_object getEmployee_ranks_objectByDepartmentIDandObject(int department_id, int object_id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getEmployee_ranks_objectByDepartmentIDandObject(department_id, object_id);
        }

        public static departments getTopOneDepartmentsByEmployee(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getTopOneDepartmentsByEmployee(id);
        }

        public static int getNoHDDHBydepartmentID(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getNoHDDHBydepartmentID(id);
        }

        public static int getNoHDNHBydepartmentID(int id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getNoHDNHBydepartmentID(id);
        }

        public static PagedList<employee_reward_individual> getListEmployee_individual(int pageindex, int pagesize, string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_individual(pageindex, pagesize, text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static PagedList<employee_reward_collective> getListEmployee_collective(int pageindex, int pagesize, string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_collective(pageindex, pagesize, text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }
        public static List<employee_reward_collective> getListEmployee_collective_export(string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_collective_export(text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static List<employee_reward_individual> getListEmployee_individual_export(string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_individual_export(text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static PagedList<proc_employee_reward_individual_total_Result> getListEmployee_individual_total(int pageindex, int pagesize, string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_individual_total(pageindex, pagesize, text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static List<proc_employee_reward_individual_total_Result> getListEmployee_individual_export_total(string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_individual_export_total(text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static PagedList<proc_employee_reward_collective_total_Result> getListEmployee_collective_total(int pageindex, int pagesize, string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_collective_total(pageindex, pagesize, text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static List<proc_employee_reward_collective_total_Result> getListEmployee_collective_export_total(string text_search, DateTime? from_date, DateTime? to_date, string list_id, ref List<int> total_all, ref List<int> total_skill_reward_1, ref List<int> total_skill_reward_2, ref List<int> total_skill_reward_3)
        {
            profile_service proSvc = new profile_service();
            return proSvc.getListEmployee_collective_export_total(text_search, from_date, to_date, list_id, ref total_all, ref total_skill_reward_1, ref total_skill_reward_2, ref total_skill_reward_3);
        }

        public static void deleteEmployee(int employee_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployee(employee_id);
        }

        public static void deleteEmployeeMedicalByID(int medical_records_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployeeMedicalByID(medical_records_id);
        }

        public static void deleteEmployeeFamilyByID(int family_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployeeFamilyByID(family_id);
        }

        public static void deleteEmployeeInsuranceByID(int insurance_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployeeInsuranceByID(insurance_id);
        }

        public static void deleteEmployeeSchoolByID(int school_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployeeSchoolByID(school_id);
        }

        public static void deleteEmployeeVisaPassportByID(int passport_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployeeVisaPassportByID(passport_id);
        }

        public static void deleteContractByID(int contract_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteContractByID(contract_id);
        }

        public static void deleteEmployeeJobSeveranceByID(int job_severance_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteEmployeeJobSeveranceByID(job_severance_id);
        }

        public static int deleteObjectEmployeeByID(int object_employee_id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.deleteObjectEmployeeByID(object_employee_id);
        }

        public static int deleteTypeContractByID(int type_contract_id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.deleteTypeContractByID(type_contract_id);
        }

        public static int deleteTypeLeaveByID(int type_leave_id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.deleteTypeLeaveByID(type_leave_id);
        }

        public static int deleteTypeRewardByID(int type_reward_id)
        {
            profile_service proSvc = new profile_service();
            return proSvc.deleteTypeRewardByID(type_reward_id);
        }

        public static void deleteRewardByID(int reward_id)
        {
            profile_service proSvc = new profile_service();
            proSvc.deleteRewardByID(reward_id);
        }
    }
}